﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ListPost.ascx.cs" Inherits="Modules_Posts_Controls_ListPost" %>
<%@ Register TagPrefix="avg" Namespace="Avg.Controls" Assembly="SmartPager" %>
  <script src="/Admin/Modules/Menu/js/Menuedit.js" type="text/javascript"></script>
<div class="archive">
    <h3>Lưu trữ trong thư mục:
        <%=CategoryName%>
        <script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>
        <g:plusone size="medium"></g:plusone>
        <div class="fb-like" data-send="false" data-layout="button_count" data-width="450"
            data-show-faces="false" data-font="arial">
        </div>
    </h3>
    <ul class="posts">
        <asp:Repeater ID="rpt" runat="server">
            <ItemTemplate>
                <li>
                    <div class="cover">
                        <a title="<%#Eval("Title") %>" rel="bookmark" href="<%#UrlBuilder.GetNewsDetail(Eval("TextId").ToString(),Eval("CreatedDate")) %>">
                            <img alt="<%#Eval("Title") %>" src="<%#UrlBuilder.GetImage(Eval("ImageUrl").ToString(),160,120,true) %>"
                                style="width: 160px; height: 120px;" /></a>
                    </div>
                    <div class="postcontent">
                        <h2 class="title">
                            <a title="<%#Eval("Title") %>" href="<%#UrlBuilder.GetNewsDetail(Eval("TextId").ToString(),Eval("CreatedDate")) %>">
                                <%#Eval("Title") %></a></h2>
                        <div class="meta">
                            <span class="cat_icon"><a rel="category tag" title="View all posts in <%#Eval("TermTaxonomyName")%>"
                                href="<%#UrlBuilder.GetCategory(Eval("Slug").ToString()) %>">
                                <%#Eval("TermTaxonomyName")%></a></span> <span class="date_icon">
                                    <%#FormatString.DateTimeToString(Eval("ModifiedDate").ToString()) %></span>
                            <span class="comm_icon"><a title="Jump to the comments" href="<%#UrlBuilder.GetNewsDetail(Eval("TextId").ToString(),Eval("CreatedDate")) %>#commentspost">
                        <%#Wp.BLL.TblCommentsManager.CreateInstant().NumCommentOfPost(Eval("Id").ToInt()) %> bình luận</a></span>
                            <%#GetCodeEdit(Eval("Id")) %> <a <%=GetAvaliableDelete() %>> | </a><a href="#<%#Eval("Id") %>" class="delete" <%=GetAvaliableDelete() %>>Delete</a>
                        </div>
                        <p>
                            <%#FormatString.SplitString( Eval("Summary"),320) %>
                        </p>
                    </div>
                    <div class="cleaner">
                        &nbsp;
                    </div>
                </li>
            </ItemTemplate>
        </asp:Repeater>
    </ul>
    <div class="cleaner">
        &nbsp;
    </div>
    <div class="tablenav">
        <div class="tablenav-pages">
            <avg:SmartPager ID="smartPager1" runat="server" Visible="false" />
        </div>
    </div>
    <%--  <div class="navigation">
        <div class="floatleft">
        </div>
        <div class="floatright">
            <a href="/category/tin-tuc/gia-dinh-phat-tu-viet-nam/">
                Bài viết mới →</a></div>
    </div>--%>
    <div class="cleaner">
        &nbsp;
    </div>
</div>
<script type="text/javascript">

    $(document).ready(function () {
        var myMenu = new Menu();
        $("a.delete").click(function () {
            var id = $(this).attr("ref");
            if (confirm('Are you sure to delete')) {
                var Id = $(this).attr("href").replace("#", "");
                var Id2 = myMenu.DeleteMenu(Id);
                if (Id2 == -1) {
                    alert("Error!");
                }
                //$('#tag-' + Id).remove();
            }
            return false;
        });
    });
</script>
